home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
program
/
ddj0897.zip
/
DYN401.ZIP
/
class
/
setseq.d
< prev
next >
Wrap
Text File
|
1996-02-04
|
1KB
|
69 lines
/*
*
* Copyright (c) 1993-1996 Algorithms Corporation
* 3020 Liberty Hills Drive
* Franklin, TN 37067
*
* ALL RIGHTS RESERVED.
*
*
*
*/
#include "set1.h"
defclass SetSequence : Sequence {
int iTabidx;
int iSize;
NODE *iTab;
NODE iCurrent;
};
cmeth gNewSetSeq, <vNew> (int size, int nelm, void *tab)
{
object seq = gNew(super);
ivType *iv = ivPtr(seq);
iSize = size;
iTab = (NODE *) tab;
if (nelm) {
for (; !iTab[iTabidx] ; ++iTabidx);
iCurrent = iTab[iTabidx];
}
return seq;
}
imeth gNext()
{
NODE n;
if (n = iCurrent) {
if (!(iCurrent = iCurrent->next))
while (++iTabidx < iSize)
if (iTab[iTabidx]) {
iCurrent = iTab[iTabidx];
break;
}
return n->luk;
}
return gDispose(self);
}
/*
*
* Copyright (c) 1993-1996 Algorithms Corporation
* 3020 Liberty Hills Drive
* Franklin, TN 37067
*
* ALL RIGHTS RESERVED.
*
*
*
*/